package com.mengfx.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mengfx.bean.NiuDan;
import com.mengfx.mapper.NiuDanMapper;
import com.mengfx.service.NiuDanService;

@Service("niuDanService")
public class NiuDanServiceImpl implements NiuDanService {

	@Autowired
	private NiuDanMapper niuDanMapper;
	
	public List<NiuDan> getAllObject() {
		return niuDanMapper.getAllObject();
	}

	public boolean insertNiuDan(NiuDan record) {
		return niuDanMapper.insertSelective(record) > 0;
	}

	public boolean deleteNiuDan(Long id) {
		NiuDan record = new NiuDan();
		record.setId(id);
		record.setArchive(true);
		return niuDanMapper.updateByPrimaryKeySelective(record) > 0;
	}

}
